package com.liu.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitConfig {

    @Bean
    public Queue queue(){
        return  new Queue("lazy-queue");
    }


    @Bean
    public LazyExchange lazyExchange(){
        return new LazyExchange("lazy-ex");
    }

    @Bean
    public Binding binding(LazyExchange lazyExchange,Queue queue){
        return BindingBuilder.bind(queue).to(lazyExchange).with("lazy").noargs();
    }




}
